 export default function(state,action){
	switch(action.type){
		case "ADD_CAR":  
		var isT = true
			 //console.log(state)
			
			 for(var i in state){
			 	if(state[i].id == action.goods.id){
			 		state[i].num = Number(state[i].num) + Number(action.goods.num)
			 		//console.log("相同")
			 		isT = false 
			 		break;
			 	}else{
			 		isT = true
			 	}
			 }
			 
			 if(isT){
			 	state.push(action.goods)
			 	//console.log("不同")
			 }
			 return state
			break;
			default : 
            return state;
            break;
	}
}

 